﻿@model IEnumerable<OPLWeb.Models.Team>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.TeamName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Points)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Matches)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Won)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Lost)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Tied)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.NoResult)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Average)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.NumberOfPlayers)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CashRemaining)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ImageUrl)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.TeamName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Points)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Matches)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Won)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Lost)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Tied)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NoResult)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Average)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NumberOfPlayers)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CashRemaining)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImageUrl)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
    </tr>
}

</table>
